<!DOCTYPE html>
<html lang="en">
<head>
	<script src="D:\h5\daima\workspace2\ajax\jquery-2.2.4.min.js"></script>
	<script type="text/javascript">	
	$(function(){
$("#tijiao").click(function(){
	 var pwd = $("input[name='pwd']").val();
     var pwd1 = $("input[name='pwd1']").val();
	if(pwd !=pwd1){
	alert("密码不一致！")
	$("input[name='pwd']").val("");
    $("input[name='pwd1']").val("");
    }else{
    	// alert("修改成功！")
    	 	var obj = {
            username:$("#username").val(),
            email:$('#address').val(),
            address:$('#address').val(),
            pwd:$("input[name='pwd']").val(),
            oldPwd:$("input[name='oldPwd']").val(),
          };
          alert("修改成功！")
          $.ajax({
                cache:true,//保留缓存数据
                type:"POST",
                // dataType : "json",
                url:"http://192.168.19.121:8080/teamwork11/UpdateUserInfoServlet",
                data:obj,
                // asynckey: true,
                success:function (data) {
                  if (data) {
                     
          }                                 
         }                         
      });      
    }
})
});

</script>


	<style type="text/css">
form{	
	margin: 0 auto;
}
body{
	background-color: gray;
}
</style>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div id="form-id" style="text-align: center">
	<p><input type="text" name="username" placeholder="用户名" id="username" value=""></p>
	<p><input type="password" name="oldPwd" placeholder="原密码"id="oldPwd" value=""></p>
	<p><input type="password" name="pwd"placeholder="密码"id="pwd" value=""></p>
	<p><input type="password" name="pwd1"placeholder="确认密码"id="pwd1" value=""></p>	
	<p><input type="text" name="email"placeholder="邮箱"id="email" value=""></p>
	<p><input type="hidden" name="id"placeholder=""id="" value=""></p>
	<p>修改头像：<input type="file" name="img" value="" ></p>
	<p><input type="hidden" name="imgName" value=""></p>
	<p><input type="text" name="userType" disabled="disabled" value=""></p>
	<button id="tijiao" >提交</button>
</div>	
</body>
</html>